Cannot open second excel with dxl

Hello,

may be someone know how to handle my problem and can help.

The case is:

- I have already running Excel Application,

- with the following code I try to run a dxl (both directly in DOORS module or with Excel macro)

- second Excel Workbook doesn't open

Does somebody know what I am doing wrong? (The problem is independent of Excel format. In case all Excel Worbooks are closed the code works very well.)

 

// Open a file in Excel
OleAutoObj openExcelFile(string sFileName, bool bVisible)
{
 OleAutoObj oleWorkbooks  = null
 OleAutoObj oleExcel   = null
 OleAutoArgs autoArgs   = create

 oleExcel = oleGetAutoObject("Excel.Application")
 if (null oleExcel)
 {
  oleExcel = oleCreateAutoObject("Excel.Application")
  if(null oleExcel)
  {
      errorBox("Unable to open excel application")
  }
  olePut (oleExcel, "Visible", bVisible)
  
  // Get workbooks and open file
  clear autoArgs
  oleGet(oleExcel,"Workbooks", oleWorkbooks)
  put(autoArgs,"Filename", sFileName)
  oleMethod(oleWorkbooks,"Open",autoArgs)
 }
 delete autoArgs
 return oleExcel
}

// Main
OleAutoObj oleExcel   = openExcelFile("D:/test/test.xlsb", true)

 


Anta_st - Thu Aug 13 04:21:25 EDT 2015

Re: Cannot open second excel with dxl
Anta_st - Thu Aug 13 05:26:56 EDT 2015

Ok, that was pretty stupid question :). Sometimes can't just see the Wood for trees...

Re: Cannot open second excel with dxl
woodpryan - Thu Aug 13 12:11:05 EDT 2015

Anta_st - Thu Aug 13 05:26:56 EDT 2015

Ok, that was pretty stupid question :). Sometimes can't just see the Wood for trees...

I assume this means you figured it out and don't need any help?

Re: Cannot open second excel with dxl
Anta_st - Thu Aug 13 15:25:55 EDT 2015

woodpryan - Thu Aug 13 12:11:05 EDT 2015

I assume this means you figured it out and don't need any help?

Yes, thank you, no help is needed.

Re: Cannot open second excel with dxl
smarti.sj - Fri Aug 14 08:21:31 EDT 2015

Anta_st - Thu Aug 13 05:26:56 EDT 2015

Ok, that was pretty stupid question :). Sometimes can't just see the Wood for trees...

no worries ... happens to all of us